package com.game;
import java.util.Collections;
import java.util.Stack;

public class Deck {
	private String[] ranks = {"A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"};
	private String[] suits = {"Spade", "Heart", "Diamond", "Club"};
	private Stack<Card> deck;
	
	public Deck() {
		
	}
	
	public void Initialize() {
		deck = new Stack<Card>();
		for (String rank : ranks) {
			for (String suit : suits) {
				deck.push(new Card(rank, suit));
			}
		}
		Collections.shuffle(deck);
		
//		deck.push(new Card("7", "Diamond"));
//		deck.push(new Card("Q", "Heart"));
//		deck.push(new Card("7", "Diamond"));
//		deck.push(new Card("A", "Heart"));
//		deck.push(new Card("7", "Heart"));
//		deck.push(new Card("K", "Heart"));
	}
	
	public Card draw() {
		if (deck.empty()) {
			return null;
		}
		return deck.pop();
	}
	
}
